<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
<?php
$_google = isset($_GET['q']) ? $_GET['q'] : (isset($_GET['filter']) ? $_GET['filter'] : (isset($_GET['s']) ? $_GET['s'] : ''));
$_google = urldecode(trim($_google));
?>
        <meta content="text/html; charset=UTF-8" http-equiv="content-type" />
        <title> <?php echo $_google ? $_google." - " : ''?>搜索结果 - <?=SITE_NAME?> </title>
        <?php include VIEWS.'header.html'?>

        <style type="text/css">
            #sresult {
                line-height: 140%;
            }

            #sresult .gsc-control {
                width: 90%;
            }

            #sresult .gsc-search-box {
                width: 400px;
                margin: 0 auto 1em;
            }
            
            #sresult .gsc-tabhActive {
                font-size: 15px;
                font-weight: bold;
                border-top: 2px solid #FF6600;
            }

            #sresult .gs-result {
                margin: .6em;
            }

            #sresult .gs-snippet {
                font-size: 12px;
                color: #666;
            }

            #sresult .gs-relativePublishedDate, #sresult .gs-visibleUrl, #sresult .gs-visibleUrl-long {
                font-size: 11px;
                display: block;
            }

            #sresult .gs-visibleUrl-short {
                display: none;
            }

            #sresult .gsc-cursor-box {
                text-align: center;
                padding: .5em;
            }

            #sresult a:hover {
                background: #FFF;
                color: #FF6600;
            }

            #sresult .gsc-cursor-current-page {
                color: #FF6240;
            }

            #sresult .gsc-cursor-page {
                border: 1px solid #DDD;
                padding: 2px 4px;
                text-decoration: none;
            }

            #sresult .gsc-cursor-page:hover {
                color: #FFF;
                background: #3366CC;
            }
        </style>

        <script src="http://www.google.com/jsapi?key=ABQIAAAA1_dSUwJm2BvCGNYaVdDmAxQkc_fJsJYCNjcuIFnYKl_N2Xjm_hS2aRrRGZp163uvsJ1vMe6dmV_mTw" type="text/javascript"></script>
        <script type="text/javascript">
        //<![CDATA[
        google.load('search', '1');

        function OnLoad() {
            var searchControl = new google.search.SearchControl();
            var search;

            var options = new google.search.SearcherOptions();
            options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
            options.setNoResultsString('没找到您需要的结果，换个关键字再试试？ 有问题欢迎联系我们的在线客服。');
            searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);

            search = new google.search.WebSearch();
            search.setUserDefinedLabel("所有内容");
            search.setUserDefinedClassSuffix("siteSearch");
            search.setSiteRestriction("loopo.cn");
            searchControl.addSearcher(search, options);
            
            search = new google.search.WebSearch();
            search.setUserDefinedLabel("&nbsp; 产品 &nbsp;");
            search.setUserDefinedClassSuffix("productSearch");
            search.setSiteRestriction("008779118819874359011:hz-ug3ke7jm");
            searchControl.addSearcher(search, options);

            search = new google.search.WebSearch();
            search.setUserDefinedLabel("&nbsp; 评论 &nbsp;");
            search.setUserDefinedClassSuffix("reviewSearch");
            search.setSiteRestriction("008779118819874359011:qd4ot10upgm");
            searchControl.addSearcher(search, options);

            search = new google.search.BlogSearch();
            search.setUserDefinedLabel("&nbsp; 博客 &nbsp;");
            search.setUserDefinedClassSuffix("blogSearch");
            search.setSiteRestriction("loopo.cn/blog");
            searchControl.addSearcher(search, options);

            var drawOptions = new google.search.DrawOptions();
            drawOptions.setDrawMode(GSearchControl.DRAW_MODE_TABBED);

            searchControl.draw($("sresult"), drawOptions);
            searchControl.execute("<?php echo $_google?>");
        }

    google.setOnLoadCallback(OnLoad, true);
    //]]>
    </script>

    </head>

    <body>

        <?php include VIEWS.'topbar.html'?>

        <div id="content">
            <?php include VIEWS.'leftnav.html'?>

            <div id="right">

                <h1><?php echo $_google ? "在乐铺搜索 \"$_google\" 的结果" : 'LooPo 搜索'?></h1>
                <div style="float:right;margin-right:2em" class="px12"> &#8250; <script type="text/javascript">needHelp();</script><noscript><a href="<?php echo $_servername?>/forum/service/?from=itemlist" target="_blank">需要帮助？</a></noscript>&nbsp;&nbsp; </div>
                <div id="sresult"></div>

            </div>
        </div>

    <?php include VIEWS.'copyright.html'?>

    </body>
</html>
